const winston = require('winston')

const isProduction = process.env.NODE_ENV === 'production'

const logger = new winston.Logger({
  level: isProduction ? 'error' : 'debug',
})
logger.add(winston.transports.Console, {
  name: 'console.info',
  colorize: true,
  showLevel: true,
})

logger.transports['console.info'].silent = isProduction

module.exports = logger
